<template>
  <view class="margin-top-20">
    <tui-list-cell v-for="(item,index) in payWayList" :key="index" unlined padding="20rpx 0" @click="change(item,index)">
      <view class="flex-row flex-item justify-between">
        <view class="flex-row flex-center">
          <!--          <image class="pay-item-icon" :src="'https://tbb-file.oss-cn-shenzhen.aliyuncs.com/user_uniapp/static/icons/'+val.icon" mode="widthFix" />-->
          <text class="text-28 color-t1">{{ item.label }}</text>
        </view>
        <l-check-box type="circle" size="50rpx" :value="chooseInx === index" />
      </view>
    </tui-list-cell>
  </view>
</template>

<script>
export default {
  name: 'PayWay',
  data() {
    return {
      chooseInx: 0
    }
  },
  computed: {
    payWayList() {
      const def = [
        { icon: 'wechat_pay_ico.png', label: '微信', payType: 5, providerId: 'appCompany' }
      ]

      /* #ifdef APP-PLUS*/
      /* const app = [
        { icon: 'alipay_ico.png', label: '支付宝', payType: 6, providerId: 'alipay' },
        { icon: 'wechat_pay_ico.png', label: '苹果', payType: '', providerId: 'apple' }
      ]
      def.push(...app)*/
      /* #endif*/

      return def
    }
  },
  created() {
    this.change(this.payWayList[0], 0)
  },
  methods: {
    change(e, inx) {
      this.chooseInx = inx
      this.$emit('change', e)
    }
  }
}
</script>

<style scoped>

</style>
